Method and Device for Storing a Portion of a Video Stream

ABSTRACT

The invention relates to a method for storing a portion of a compressed video stream, said compressed video stream comprising a series of compressed key images between which are inserted intermediate frames comprising at least the encoding of differences between an uncompressed intermediate image and the key image immediately preceding same, said method comprising: acquiring, in real time, the compressed video stream; temporarily storing, without decompression, the acquired compressed video stream, said temporary storage comprising at least the last compressed key image received and the subsequent intermediate frames; upon receipt of a permanent storage start event at a given instant: reconstructing a compressed key image corresponding to said given instant starting from the last key image received and from the subsequent intermediate frames; and storing the portion of the video stream starting with the reconstructed compressed key image.

The present invention relates to a method and a device for storing aportion of a compressed video stream and to a computer program productfor implementing the method.

At present, among the video stream compression methods used, the mostwidely used compression encoding is that defined by the MPEG workinggroup, more particularly in the ISO/IEC 13818-MPEG-2 and ISO/IEC14496-MPEG-4 standards. These two standards are very similar in thecompression principles used: certain images are stored and compressed atregular intervals and, for the intermediate images, only the differencesare stored and encoded.

More precisely, the MPEG compression uses an estimation of movement. TheMPEG encoding breaks down each image into blocks called macroblocks, andexamines the adjacent images to see if there are similar blocks. If acorrespondence is found, rather than storing the entire block, thesystem stores a much smaller vector describing how the block has moved(or not moved) between the images. The vectors are encoded such thatthey can use only a single bit in certain cases which means that thebackgrounds and other elements which do not move over time arecompressed very efficiently. Similarly, large groups of blocks whichmove together, such as a large object or scrolling of the entire image,are also efficiently compressed.

MPEG uses three types of image encoding methods.

Intra-frames, or I frames, in which an entire image is compressed andstored with a DCT (Discrete Cosine Transform) quantification. Thiscreates a reference image on the basis of which the following images areconstructed. These I frames also allow random access in the video streamand, in practice, are generated about every half-second.

Predictive frames, or P frames, contain movement vectors describing thedifference after the I frame or the closest preceding P frame.

The frames of the third type are the bidirectional frames or B frames.The system looks forward or backward in order to find correspondingblocks. In this way, if something new appears in a B frame, it can bepaired with a block of the next I or P frames. It can therefore beunderstood that, statistically, the P and B frames are much smaller thanthe I frames.

As mentioned above, a compressed video stream can only start on an Iframe serving as a first reference image on the basis of which thefollowing P or B frames will be constructed. As stated above, these Iframes are also used for random access to the video stream. However, itis understood that a problem arises when it is desired to record, orstore, only a portion of the video stream, with a random start, andtherefore not necessarily corresponding with an I frame.

In order to solve this problem, the current recording systemscontinuously decode the compressed video stream so that, when the userof the system decides to start a recording, the decompressed imagecorresponding to this start of recording is encoded again in the form ofan I frame. The following frames are then re-encoded on the basis ofthis I frame or, if the encoding so allows, the following B or P framesare retained but as differential images of the reconstructed I image.For the best-performance systems, and in order not to lose quality dueto encoding followed by re-encoding, the system also detects the first Iframe of the incoming compressed video stream following the start of therecording and, starting from this frame, stores the incoming compressedvideo stream without transformation.

This solution has the drawback of imposing a continuous decoding of theincoming compressed video stream whilst waiting for the instruction tostart recording. This drawback is not important when the apparatus isconnected to a display device so that the user can view the incomingcompressed video stream in real time since the decoding then has to becarried out for the display. On the other hand, in systems not requiringthis decoding for display, this becomes extremely penalizing in terms ofmachine resources.

It would also be particularly advantageous to have a method and a devicefor storing a portion of compressed video stream allowing a minimizingof computing resources.

Therefore, according to an aspect of the invention, a method for storinga portion of a compressed video stream, said compressed video streamcomprising a series of compressed key images between which are insertedintermediate frames comprising at least the encoding of differencesbetween an uncompressed intermediate image and the immediately precedingcompressed key image, comprises: acquiring, in real time, the compressedvideo stream,

-   -   temporarily storing, without decompression, the acquired        compressed video stream, said temporary storage comprising at        least the last compressed key image received and the subsequent        intermediate frames,    -   upon receipt of a permanent storage start event at a given        instant:    -   reconstructing a compressed key image corresponding to said        given instant on the basis of said last compressed key image        received and the subsequent intermediate frames,    -   storing the portion of the video stream starting with the        reconstructed compressed key image.

According to a particular embodiment, when the temporary storage of thevideo stream exceeds a predetermined storage size, a compressed keyimage is reconstructed from said last compressed key image received andfrom the subsequent intermediate frames and then the last compressed keyimage received is replaced in the temporary storage by the reconstructedcompressed key image.

According to another particular embodiment, the compressed video streamis a video stream encoded according to one of the ISO/IEC 13818-MPEG 2,ISO/IEC 14496—MPEG-4 and H264 standards.

According to a second aspect of the invention, a computer programproduct comprises program code instructions recorded on a medium thatcan be read by a computer, in order to implement the steps of the abovemethod when said program is running on a computer.

According to a third aspect of the invention, a device for storing aportion of a compressed video stream, said compressed video streamcomprising a series of compressed key images between which are insertedintermediate frames comprising at least the encoding of differencesbetween an uncompressed intermediate image and the immediately precedingkey image, comprises:

-   -   means of acquiring, in real time, the compressed video stream,    -   means of receiving a permanent storage start event at a given        instant, connected to triggering means:    -   means of storing the portion of video stream starting from the        given instant, characterized in that it moreover comprises    -   means of temporarily storing, without decompression, the        acquired video stream, said temporary storage means comprising        at least the last compressed key image received and the        subsequent intermediate frames, and    -   means of reconstructing a compressed key image corresponding to        said given instant on the basis of said last compressed key        image received and the subsequent intermediate frames such that        the portion of the video stream stored starts with said        reconstructed compressed key image.

The invention will be better understood on reading the followingdescription, given solely by way of example and with reference to theattached figures in which:

FIG. 1 is a block diagram of an example of a method for storing videostream according to the prior art;

FIG. 2 is a block diagram of an example of a storing method according toan embodiment of the invention;

FIG. 3 is a flowchart of a storing method according to an embodiment ofthe invention; and

FIG. 4 is a block diagram of a storage device according to an embodimentof the invention.

FIG. 1 represents a video stream in the MPEG format comprising twocompressed I images (in other words, two I frames) referenced 1 and 2along a time axis AA. The compressed I image I 1 is therefore prior tothe compressed I image I 2.

Between these compressed I images are inserted P frames 11, 12, 13, 21,22, 23 and 24.

The corresponding stream is symbolized on the axis BB, in the form of astream of decoded F images 31 to 39.

Thus, in a standard fashion, the decoded F image F 31 is obtained bydecompressing the compressed I image I 1 and the decoded F image F 35 isobtained by decompressing the compressed I image I 2. The F image F 32is obtained by modification of the F image F 31 as a function of themovement vectors contained in the P frame P 11, this modification beingsymbolized by the sign “+” in FIG. 1. The F image F 33 is obtained bymodification of the F image F 32 as a function of the movement vectorscontained in the P frame P 12 and so on for the decoded imagescorresponding to the P frames of the encoded video stream.

FIG. 2 shows, in its upper section, the same encoded video stream asthat of FIG. 1 with the same references.

At any time, a record request D is triggered by a user. By way ofillustration, the record request D occurs temporally between the Pframes 23 and 24.

The lower section of FIG. 2 represents the content of a temporarystorage zone S.

The frames are stored as they arrive and the temporary storage S isreset to zero at each arrival of a compressed I image.

Thus, the storage contains the compressed image I 1, then the frames I 1and P 11, then the frames I 1, P 11 and P 12 then the frames I 1, P 11,P 12 and P 13. When the compressed image I 2 arrives, the temporarystorage S is emptied and only the compressed image I 2 remains stored,and so on.

When the record request D is received, the temporary storage S thereforecontains the compressed image I 2 and the frames P 21, P 22 and P 23.

The latter are combined in order to obtain the decoded image F 38 asexplained above, the latter then being re-encoded as a compressed Iimage 40.

The frame P 24 which contains the differences between the images F 38and F 39 therefore also contains the movement vectors making it possibleto decode the image F 39 from the image I 40.

Then the continuation of the video stream is recorded without anytranscoding operation.

Thus, the storage method, as shown in FIG. 3, consists in:

-   -   acquiring (step 50) the compressed video stream in real time and        in    -   storing it (step 52) temporarily, without decompression such        that the storage comprises at least the last compressed I image,        or key image, acquired and the subsequent intermediate P and B        frames.

Thus, when a start recording, or in other words permanent storage, eventis received (step 54), a key image is reconstructed (step 56) from thelast key images and the intermediate images received in order to obtaina key image corresponding to the start of recording instant and then thevideo stream is stored (step 58) without modification, i.e. without anydecoding encoding operation.

In order to carry out this method, it is possible to produce a dedicatedmachine comprising, as shown in FIG. 4:

-   -   means 60 of acquiring the compressed video stream in real time;    -   means 62 of receiving a permanent storage start event at a given        instant, connected to triggering means 64, such as for example a        push button allowing a user to indicate a permanent storage        start event by means of a single push; and    -   means 66 of storing the portion of video stream starting from        the given instant. This dedicated machine also comprises:    -   means 68, of temporary storage, without decompression, of the        acquired video stream, adapted for storing at least the last key        image received and the subsequent intermediate frames; and    -   means 70 of reconstructing a key image corresponding to the        start of storage instant from the frames stored in the temporary        storage means 68, such that the portion of video stream stored        in the storage means 66 begins with this key image.

This dedicated machine comprises a mixture of hardware and software.

Thus, for example, the temporary storage means 68 are composed of RAMs(Random Access Memories), or even of memories of the FIFO (First InFirst Out) type, in order to allow rapid access to the stored data, andthe storage means 68 are composed of hard disks, magnetic tapes oroptical disks providing high capacity permanent storage.

The reconstruction means can be produced using a combination of amicroprocessor and software. Speed requirements can however prompt thoseskilled in the art to use a signal processing processor programmed bysoftware or a logic circuit in which the functions are implemented inthe form of a network of logic gates.

In general, the software is in the form of a computer program productcomprising program code instructions recorded on a medium that can beread by a computer, in order to implement the steps of the describedstorage method.

A variant implementation of this method consists, in the context of acompromise between the size of the temporary storage and the computingmeans used, in reconstructing a key image form the images contained inthe temporary storage as soon as the temporary storage of the imagesexceeds a predetermined storage size and then in retaining only thatreconstructed key image in the temporary storage together with thesubsequent intermediate images. It will be understood that thisoperation makes it possible to reduce the size of the temporary storageto the detriment of an additional reconstruction operation.

The invention has been illustrated and described in detail in thedrawings and the above description. The latter must be considered asillustrative and given by way of example and not as limiting theinvention to this description alone. Many variant embodiments arepossible.

For example, other standards such as the H264 standard are suitable forthe using the described method.

Similarly, after the reconstruction of the I image corresponding to thestart of recording, the encoding of the immediately following frames cannecessitate re-encoding them so that they comprise the differences withthe reconstructed I image.

In the claims, the word “comprising” does not exclude other elements andthe indefinite article “a” does not exclude a plurality.

1. A method for storing a portion of a compressed video stream, thecompressed video stream comprising a series of compressed key imagesbetween which are inserted intermediate frames comprising at least theencoding of differences between an uncompressed intermediate image andthe immediately preceding compressed key image, the method comprising:acquiring, in real time, the compressed video stream; temporarilystoring, without decompression, the acquired compressed video stream,the temporary storage comprising at least the last key image receivedand the subsequent intermediate frames, upon receipt of a permanentstorage start event at a given instant: reconstructing a key imagecorresponding to the given instant on the basis of the last key imagereceived and the subsequent intermediate frames, and storing the portionof the video stream starting with the reconstructed key image.
 2. Themethod according to claim 1, wherein, when the temporary storage of thevideo stream exceeds a predetermined storage size, a compressed keyimage is reconstructed from the last compressed key image received andfrom the subsequent intermediate frames and then the last compressed keyimage received is replaced in the temporary storage by the reconstructedcompressed key image.
 3. The method according to claim 1, wherein thecompressed video stream is a video stream encoded according to one ofthe ISO/IEC 13818-MPEG 2, ISO/IEC 14496 - MPEG-4 and H264 standards. 4.A computer program product comprising program code instructions recordedon a medium that can be read by a computer, in order to implement thefollowing steps, when the program is running on a computer, for storinga portion of a compressed video stream, the compressed video streamcomprising a series of compressed key images between which are insertedintermediate frames comprising at least the encoding of differencesbetween an uncompressed intermediate image and the immediately precedingcompressed key image; acquiring, in real time, a compressed videostream; temporarily storing, without decompression, the acquiredcompressed video stream, the temporary storage comprising at least thelast key image received and the subsequent intermediate frames; and uponreceipt of a permanent storage start event at a given instant;reconstructing a key image corresponding to the given instant on thebasis of the last key image received and the subsequent intermediateframes, and storing the portion of the video stream starting with thereconstructed key image.
 5. A device for storing a portion of acompressed video stream, the compressed video stream comprising a seriesof compressed key images between which are inserted intermediate framescomprising at least the encoding of differences between an uncompressedintermediate image and the immediately preceding key image, the devicecomprising: means of acquiring, in real time, the compressed videostream, means of receiving a permanent storage start event at a giveninstant, connected to triggering means, means of storing the portion ofvideo stream starting from the given instant, means of temporarilystoring, without decompression, the acquired compressed video stream,the temporary storage means comprising at least the last compressed keyimage received and the subsequent intermediate frames, and means ofreconstructing a compressed key image corresponding to said the giveninstant on the basis of said the last compressed key image received andthe subsequent intermediate frames such that the portion of the videostream stored starts with the reconstructed compressed key image.